<?php

namespace App\HttpController\Api\Admin;

use App\Service\Admin\DictTypeService;
use App\Service\Admin\WorkerService;
use Swoole\Http\Status;

/**
 * 教职工管理-控制器
 * @author LZH
 * @since: 2021/08/12
 * Class Worker
 * @property WorkerService $service
 */
class Worker extends AdminBase
{
    /**
     * 初始化方法
     * @author LZH
     * @since: 2021/08/12
     */
    protected function init(): void
    {
        $this->service = new WorkerService();
    }

    public function getWorkersIdName(): bool
    {
        return $this->message(Status::OK, $this->service->getWorkersIdName());
    }

    public function getIdcardTypes()
    {
        $dictTypeService = new DictTypeService();
        return $this->message(Status::OK, $dictTypeService->getDictionaryByDictType('idcard_type'));
    }
}
